// 引入 Vue
import Vue from "vue";

// 引入 App 组件
import App from "./App.vue";

Vue.config.productionTip = false;

// 注册全局过滤器
Vue.filter("formateDate", (value) => {
  // 判断
  if (typeof value !== "number") return value;
  if (!value) return "";

  const date = new Date(value);
  const year = date.getFullYear();
  const month = date.getMonth() + 1;
  const day = date.getDate();

  return `${year}-${month}-${day}`;
});

new Vue({
  render: (h) => h(App),
}).$mount("#app");
